import Link from 'umi/link'

import dynamic from 'umi/dynamic';

const delay = (timeout) => new Promise(resolve => setTimeout(resolve, timeout));
const App = dynamic({
  loader: async function() {
    await delay(/* 1s */1000);
    return () => <div>I will render after 1s</div>;
  },
});

export default function() {
  return (
    <div>
      <h2>首页</h2>
      <Link to='/login'>去登陆</Link>
      <App />
    </div>
  );
}
